/* =====================================================================
   highlight-feature.css  —  hover-highlight reading feature
   Themed for the Turkish-for-Beginners lesson app (Arial; red #c41e3a /
   orange #e85d04). Feature colors arrive at runtime via --c / --c-bg,
   so there are no per-feature rules here.
   ===================================================================== */

.hf-passage {
  position: relative;
  font-family: Arial, sans-serif;
  color: #2c2c2c;
}

/* Turkish reading text (always visible) */
.hf-tr-block {
  font-size: 20px;
  line-height: 2.15;
  letter-spacing: 0.2px;
}

/* a Turkish word */
.hf-word {
  border-radius: 5px;
  padding: 1px 1px;
  transition: background 0.12s ease;
  outline: none;
}
/* interactive only once the hint is on */
.hf-passage.hint-on .hf-word { cursor: pointer; }
.hf-passage.hint-on .hf-word:hover,
.hf-passage.hint-on .hf-word.active { background: #fbf4ea; }
.hf-passage.hint-on .hf-word:focus-visible { box-shadow: 0 0 0 2px #e85d04; }

/* a morpheme; colored only when .on */
.hf-seg { transition: color 0.12s ease; }
.hf-seg.on {
  color: var(--c);
  font-weight: 700;
  border-bottom: 2px solid var(--c);   /* segmented underline = morpheme boundary */
  padding-bottom: 1px;
}

/* ---- Red hint button ---- */
.hf-hint-btn {
  margin: 20px 0 0;
  background: #c41e3a;
  color: #fff;
  border: none;
  padding: 11px 22px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  box-shadow: 0 3px 10px rgba(196, 30, 58, 0.3);
}
.hf-hint-btn:hover { background: #aa2828; transform: translateY(-1px); }
.hf-hint-btn.on { background: #7a1524; box-shadow: none; }

/* ---- English box (revealed by the hint button) ---- */
.hf-en-block {
  margin-top: 16px;
  border: 1px solid #e6ded3;
  background: #fffdfa;
  border-radius: 10px;
  padding: 14px 18px 16px;
}
.hf-en-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #c41e3a;
  margin-bottom: 8px;
}
.hf-en-para {
  font-size: 16px;
  line-height: 2.0;
  color: #6f665c;
  margin: 0;
}
.hf-en { border-radius: 4px; transition: background 0.12s ease, color 0.12s ease; }
.hf-en.on {
  background: var(--c-bg);
  color: var(--c);
  font-weight: 700;
  padding: 0 3px;
}

/* ---- Popover (morpheme breakdown) ---- */
.hf-pop-layer {
  position: absolute;
  z-index: 40;
  max-width: 320px;
  background: #ffffff;
  border: 1px solid #e6ded3;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(60, 40, 30, 0.16);
  padding: 12px 14px;
  pointer-events: none;
  font-family: Arial, sans-serif;
}
.hf-pop-morphs {
  display: flex; flex-wrap: wrap; gap: 5px;
  margin-bottom: 8px; font-size: 17px;
}
.hf-chip {
  padding: 2px 8px; border-radius: 6px; font-weight: 700;
  background: #f2efe9; color: #6b5b52;
}
.hf-chip.has-f { background: var(--c-bg); color: var(--c); }
.hf-chip.root { font-weight: 600; }

.hf-pop-roles {
  display: flex; flex-direction: column; gap: 3px;
  margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px dashed #ece7df;
}
.hf-role { font-size: 12px; color: #5a4a42; display: flex; align-items: center; }
.hf-role-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 7px; flex: 0 0 auto; }

.hf-pop-gloss { font-size: 14px; color: #2c2c2c; line-height: 1.6; }
.hf-arrow { color: #b9b0a5; }

.hf-pop-layer::after {
  content: ""; position: absolute; left: 18px; bottom: -7px;
  width: 12px; height: 12px; background: #fff;
  border-right: 1px solid #e6ded3; border-bottom: 1px solid #e6ded3;
  transform: rotate(45deg);
}
.hf-pop-layer.below::after {
  bottom: auto; top: -7px; border: none;
  border-left: 1px solid #e6ded3; border-top: 1px solid #e6ded3;
}

/* ---- Legend ---- */
.hf-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.hf-legend-item { display: inline-flex; align-items: center; font-size: 12px; color: #5a4a42; }
.hf-legend-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; margin-right: 6px; flex: 0 0 auto; }

.hf-error { color: #c41e3a; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .hf-word, .hf-seg, .hf-en, .hf-hint-btn { transition: none; }
}

/* ---- Genitive possessor <-> possessed link ---- */
.hf-linked {                      /* the partner word gets a dashed gold box */
  outline: 1.5px dashed #CA8A04;
  outline-offset: 2px;
  border-radius: 4px;
}
.hf-pop-pair {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #ece7df;
}
.hf-pair-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .4px;
  color: #CA8A04;
}
.hf-pair-chain {
  font-size: 16px;
  font-weight: 700;
  color: #CA8A04;
  margin-top: 3px;
}
